#include "Input.h"

#define PSPKEY_UP KEY_UP
#define PSPKEY_DOWN KEY_DOWN
#define PSPKEY_LEFT KEY_LEFT
#define PSPKEY_RIGHT KEY_RIGHT
#define PSPKEY_CROSS 'z'
#define PSPKEY_CIRCLE 'x'
#define PSPKEY_SQUARE 'a'
#define PSPKEY_TRIANGLE 's'
#define PSPKEY_L 'q'
#define PSPKEY_R 'w'
#define PSPKEY_START KEY_ENTER
#define PSPKEY_SELECT KEY_BACKSPACE

namespace GenBen {

class PSPInput
{
public:
	PSPInput();
	virtual ~PSPInput();

	// Keyboard
	virtual bool isKeyPressed(Key key);
	virtual bool isKeyUp(Key key);
	virtual bool isKeyDown(Key key);

	// Mouse
	virtual VectorI getMousePos() { return VectorI(0, 0); };
	virtual VectorI getMouseRelativePos() { return VectorI(0, 0); };
	virtual int getRelativeWheel() { return 0; };
	virtual bool isMouseButtonPressed(MouseButton button) { return false; };
	virtual bool isMouseButtonUp(MouseButton button) { return false; };
	virtual bool isMouseButtonDown(MouseButton button) { return false; };
	
	void update();

private:
	uint keyToMask(Key key);
	
	uint current_state, last_state;
};

} // namespace
